.container {
  max-width: 800px;
  margin: 30px auto;
  border-radius: 4px;
  box-shadow: 0 0 4px 0px rgba(0, 0, 0, 0.3);
  padding: 16px;
}

.carousel {
  position: relative;
  height: 200px;

}

.carousel .panels>a {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration-line: none;
  opacity: 0;
  z-index: 0;
  transition: all 0.3s;
}
.carousel .panels>a.active{
  opacity: 1;
  z-index: 90;
}

.carousel .panels>a:nth-child(even) {
  background: lightskyblue;
}

.carousel .panels>a:nth-child(odd) {
  background: lightpink;
}


.carousel .arrow {
  position: absolute;
  z-index: 100;
  top: 50%;
  width: 30px;
  height: 30px;
  background: rgba(31, 45, 61, .11);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s;
}

.carousel .arrow::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-left: 2px solid white;
  border-top: 2px solid white;
  transform: rotate(-45deg)
}

.carousel .arrow.arrow-next::before {
  transform: rotate(135deg)
}

.carousel .arrow-pre {
  left: 10px;
  transform: translateX(-10%) translateY(-50%);
}

.carousel:hover .arrow-pre {
  opacity: 1;
  transform: translateX(0) translateY(-50%);
}

.carousel .arrow-next {
  right: 10px;
  transform: translateX(10%) translateY(-50%);
}

.carousel:hover .arrow-next {
  opacity: 1;
  transform: translateX(0) translateY(-50%);
}

.carousel .indicators {
  position: absolute;
  z-index: 100;
  display: flex;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  list-style: none;
  margin: 0;
  padding: 0;
  width: 20%;
  height: 2px;
  align-items: center;
  justify-content: space-around;
}

.carousel .indicators>li {
  padding: 5px 0;/*设置margin没用,要padding才按了onclick有用*/
  width: 20%;
  cursor: pointer;
}

.carousel .indicators>li::before {
  content: '';
  border-radius: 4px;
  display: block;/*这个很重要*/
  height: 2px;
  background: #b1b8cb;
}

.carousel .indicators>li.active::before {
  background: white;
}